Conditions | 8 |
Paths | 4 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | var Objects = { |
||
2 | merge: function (a, b) { |
||
3 | if (typeof b === 'undefined' || b === null) { |
||
4 | return a |
||
5 | } |
||
6 | if (typeof b !== 'object' || typeof a !== 'object' || a === null) { |
||
7 | return b |
||
8 | } |
||
9 | if (Array.isArray(a) || Array.isArray(b)) { |
||
10 | return b |
||
11 | } |
||
12 | var target = {} |
||
13 | Object.keys(a).forEach(function (key) { |
||
14 | target[key] = a[key] |
||
15 | }) |
||
16 | Object.keys(b).forEach(function (key) { |
||
17 | target[key] = Objects.merge(target[key], b[key]) |
||
18 | }) |
||
19 | return target |
||
20 | }, |
||
21 | copy: function (value) { |
||
39 |